1
/****************************** Module Header ******************************\
2 * Module Name: IDownloader.cs
3 * Project: CSWebDownloader
4 * Copyright (c) Microsoft Corporation.
6 * This interface defines the basic properties and methods of a WebDownloader.
8 * This source is subject to the Microsoft Public License.
9 * See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
10 * All other rights reserved.
12 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
13 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
15 \***************************************************************************/
19 namespace CSWebDownloader
21 public interface IDownloader
23 #region Basic settings of a WebDownloader.
26 string DownloadPath { get; set; }
27 long TotalSize { get; set; }
29 ICredentials Credentials { get; set; }
30 IWebProxy Proxy { get; set; }
35 #region Support the "Pause", "Resume" and Multi-Threads feature.
37 bool IsRangeSupported { get; set; }
38 long StartPoint { get; set; }
39 long EndPoint { get; set; }
43 #region The downloaded data and status.
45 long DownloadedSize { get; }
46 int CachedSize { get; }
48 bool HasChecked { get; set; }
49 DownloadStatus Status { get; }
50 TimeSpan TotalUsedTime { get; }
54 #region Advanced settings of a WebDownloader
56 int BufferSize { get; set; }
57 int BufferCountPerNotification { get; set; }
58 int MaxCacheSize { get; set; }
63 event EventHandler
<DownloadCompletedEventArgs
> DownloadCompleted
;
64 event EventHandler
<DownloadProgressChangedEventArgs
> DownloadProgressChanged
;
65 event EventHandler StatusChanged
;
67 void CheckUrl(out string fileName
);